<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="IE=Edge" http-equiv="X-UA-Compatible">
    <title>成功加入购物车-小米商城</title>
    <meta content="width=1226" name="viewport">
    <meta content="on" http-equiv="x-dns-prefetch-control">
    <link href="${pageContext.servletContext.contextPath}/images/logo.jpg" rel="icon" type="image/x-icon">
    <meta content="no-transform " http-equiv="Cache-Control">
    <meta content="no-siteapp" http-equiv="Cache-Control">
    <link as="style" href="${pageContext.servletContext.contextPath}/st/front/CSS/successTip.da1843ba.css" rel="preload">
    <link as="script" href="${pageContext.servletContext.contextPath}/st/front/JS/successTip.5bc66a8e.js" rel="preload">
    <link as="script" href="${pageContext.servletContext.contextPath}/st/front/JS/chunk-vendors.c6d24ca0.js" rel="preload">
    <link href="${pageContext.servletContext.contextPath}/st/front/CSS/successTip.da1843ba.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/front/JS/jquery-3.2.1.min.js"></script>
    <script>
        $(document).ready(function (){
            function addCart(deid,a){
                $.get("${pageContext.servletContext.contextPath}/addCart",{deid:deid},
                    function(result){
                        if(result==1){
                            $(".recommend-tips").eq(a).html("添加成功！").show().delay(1500).fadeOut();
                        }else{
                            alert("添加失败！");
                        }
                    },"text"
                )
            };
            //获取点击元素 值为1 不能找到实际下标
            // $(".recommend-action").click(function (){
            //    var ha=$(this).index();
            //    alert(ha);
            // });
            $("div#dian").eq(0).click(function (){
               var index=$("#dian span").eq(0).html();
               addCart(index,0);
            });
            $("div#dian").eq(1).click(function (){
                var index=$("#dian span").eq(1).html();
                addCart(index,1);
            });
            $("div#dian").eq(2).click(function (){
                var index=$("#dian span").eq(2).html();
                addCart(index,2);
            });
            $("div#dian").eq(3).click(function (){
                var index=$("#dian span").eq(3).html();
                addCart(index,3);
            });
            $("div#dian").eq(4).click(function (){
                var index=$("#dian span").eq(4).html();
                addCart(index,4);
            });
            $("div#dian").eq(5).click(function (){
                var index=$("#dian span").eq(5).html();
                addCart(index,5);
            });
            $("div#dian").eq(6).click(function (){
                var index=$("#dian span").eq(6).html();
                addCart(index,6);
            });
            $("div#dian").eq(7).click(function (){
                var index=$("#dian span").eq(7).html();
                addCart(index,7);
            });
            $("div#dian").eq(8).click(function (){
                var index=$("#dian span").eq(8).html();
                addCart(index,8);
            });
            $("div#dian").eq(9).click(function (){
                var index=$("#dian span").eq(9).html();
                addCart(index,9);
            });
        });
    </script>
</head>
<body>
<!--头部 动态包含-->
<jsp:include page="/Front_Head"></jsp:include>
<div id="app">
    <div class="page-main">
        <div class="container">
            <div class="buy-succ-box clearfix">
                <div class="goods-content" id="J_goodsBox">
                    <div class="goods-img">
                        <img height="64" src="${pageContext.servletContext.contextPath}/images/success.png" width="64">
                    </div>
                    <div class="goods-info">
                        <h3>已成功加入购物车！</h3>
                        <span class="name">${shoppingcart.comname} ${shoppingcart.config}</span>
                    </div>
                </div>
                <div class="actions J_actBox">
                    <a class="btn btn-line-gray J_goBack" onclick="javascript:history.back(-1);" stat_exposure="true">返回上一级</a>
                    <a class="btn btn-primary" href="${pageContext.servletContext.contextPath}/mycart">去购物车结算</a>
                </div>
            </div>
            <div>
                <br>
                <br>
            </div>
            <div class="mi-recommend cart-recommend" data-v-1956af42="">
                <h2 class="recommend-title" data-v-1956af42="">
                    <span data-v-1956af42="">买购物车中商品的人还买了</span>
                </h2>
                <div class="recommend-bd swiper-container swiper-no-swiping swiper-container-initialized swiper-container-horizontal swiper-container-multirow" id="J_recommend_cartBuy">
                    <!--商品推荐-->
                    <ul class="recommend-list clearfix swiper-wrapper" data-v-1956af42="" style="width: 1240px; transform: translate3d(0px, 0px, 0px);">
                        <c:forEach var="list" items="${describeslist}">
                            <li class="recommend-item swiper-slide swiper-slide-active"
                                data-swiper-row="0" data-v-1956af42="" style="order: 0; width: 234px; margin-right: 14px;">
                                <a href="${pageContext.servletContext.contextPath}/FindCid/${list.cid}" >
                                    <img lazy="loaded" src="${pageContext.servletContext.contextPath}/images/${list.picture}" width="140px">
                                    <div class="recommend-name" data-v-1956af42="">${list.comname}</div>
                                    <div class="recommend-price" data-v-1956af42="">${list.depraice}元</div>
                                    <div class="recommend-tips" data-v-1956af42=""></div>
                                </a>
                                <div id="dian" class="recommend-action" data-v-1956af42="">
                                    <span style="display: none">${list.deid}</span>
                                    <a class="btn btn-small btn-line-primary" >加入购物车</a>
                                </div>
                            </li>
                        </c:forEach>
                    </ul>
                    <span aria-atomic="true" aria-live="assertive" class="swiper-notification"></span></div>
                <div class="swiper-recommend-pagination swiper-pagination-clickable swiper-pagination-bullets" data-v-1956af42=""style="display: none;">
                    <span aria-label="Go to slide 1" class="swiper-pagination-bullet swiper-pagination-bullet-active" role="button" tabindex="0"></span>
                </div>
                <div class="swiper-recommend-controls" data-v-1956af42="" style="display: none;">
					<span aria-disabled="true" aria-label="Previous slide" class="swiper-recommend-prev swiper-recommend-nav-disabled" data-v-1956af42="" role="button" tabindex="0">
						<em class="iconfont-arrow-left-big" data-v-1956af42=""></em>
					</span>
                    <span aria-disabled="true" aria-label="Next slide" class="swiper-recommend-next swiper-recommend-nav-disabled" data-v-1956af42="" role="button" tabindex="0">
						<em class="iconfont-arrow-right-big" data-v-1956af42=""></em>
					</span>
                </div>
            </div>
        </div>
    </div>

</div>
<!--尾部 动态包含-->
<jsp:include page="../tail.jsp"></jsp:include>
</body>
</html>
